package com.dopies.bsdmall.protocol;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.external.activeandroid.Model;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;

@Table(name = "RECOMMENDUESRS")
public class RECOMMENDUESRS extends Model {
	@Column(name = "parent_id")
	public int parent_id;

	@Column(name = "user_name")
	public String user_name;

	@Column(name = "user_id")
	public int user_id;

	public static RECOMMENDUESRS fromJson(JSONObject jsonObject)
			throws JSONException {
		if (null == jsonObject) {
			return null;
		}
		RECOMMENDUESRS localItem = new RECOMMENDUESRS();
		JSONArray subItemArray;
		localItem.user_id = jsonObject.optInt("id");
		localItem.parent_id = jsonObject.optInt("parent_id");
		localItem.user_name = jsonObject.optString("name");
		return localItem;
	}
}
